package com.anycl.design.principle.ocp;

import java.util.ArrayList;

public class Shop4S {

    private final static ArrayList<ICar> carList = new ArrayList<ICar>();
    private final static ArrayList<ICar> financeCarList = new ArrayList<ICar>();

    static {
        carList.add(new BenzCar("梅赛德斯-迈巴赫S级轿车", 138));
        carList.add(new BenzCar("梅赛德斯-AMG", 230));
        carList.add(new BenzCar("梅赛德斯-V级轿车", 50));

        financeCarList.add(new FinanceBenzCar("梅赛德斯-迈巴赫S级轿车", 138));
        financeCarList.add(new FinanceBenzCar("梅赛德斯-AMG", 230));
        financeCarList.add(new FinanceBenzCar("梅赛德斯-V级轿车", 50));
    }

    public static void main(String[] args) {
        System.out.println("4s店售车记录");
        for (ICar car: carList)
            System.out.println(car.getName() + "  " + car.getPrice());
        for (ICar car: financeCarList)
            System.out.println(car.getName() + "  " + car.getPrice());
    }
}
